home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d18 / opbonus.arc / ALARM.ARC / ALARM.PAS next >
Pascal/Delphi Source File  |  1991-03-20  |  2KB  |  67 lines

  1. {$S-,R-,V-,I-,B-,F+}
  2. {$M 4096,0,20480}
  3.  
  4. {*********************************************************}
  5. {*                  ALARM.PAS 1.00                       *}
  6. {*********************************************************}
  7.  
  8. {
  9.   This program pops up an alarm window at the specified time of day.
  10.   Run this program with a time specified on the command line, as in:
  11.  
  12.   ALARM 18:00
  13.  
  14.   or to specify the same time you could do:
  15.  
  16.   ALARM 6:00p
  17.  
  18.   Granted, this is not a particularly useful program. Its purpose is to
  19.   illustrate how to write Swappable TSR's that contain interrupt
  20. }
  21. program Alarm;
  22.  
  23. uses
  24.   Dos,                       {standard DOS/BIOS routines}
  25.   OpCrt,                     {Object Professional CRT unit}
  26.   OpString,                  {Object Professional string handling routines}
  27.   OpSwap1,
  28.   AlarmM,
  29.  
  30.   {portion always resident}
  31.   OpSwap;
  32.  
  33. var
  34.   SaveExitProc : Pointer;
  35.  
  36. {Note: Must be FAR (see F+ directive above)}
  37. procedure Int1CHandler; External;
  38. procedure EnableTasks; External;
  39. procedure DisableTasks; External;
  40. procedure AlarmCSData; External;
  41.  
  42. {$L AlarmI}
  43.  
  44. procedure AlarmIExitProc;
  45.  
  46. begin
  47.   ExitProc := SaveExitProc;
  48.   DisableTasks;
  49. end;
  50.  
  51. procedure InitInterrupts;
  52.  
  53. begin
  54.   SaveExitProc := ExitProc;
  55.   ExitProc := @AlarmIExitProc;
  56.   EnableTasks;
  57. end;
  58.  
  59. begin
  60.   {Set up start up and shutdown procedures.}
  61.   ShutDownProc := DisableTasks;
  62.   StartUpProc  := InitInterrupts;
  63.   AlarmData    := @AlarmCSData;
  64.   InitAlarm;                 {init popups and go resident}
  65. end.
  66.  
  67.